<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <link href="favicon.ico" rel="apple-touch-icon-precomposed" />
    <link
      href="favicon.ico"
      sizes="114x114"
      rel="apple-touch-icon-precomposed"
    />

    <link rel="shortcut icon" href="favicon.ico" />
    <link rel="icon" href="favicon.ico" />
    <link rel="Bookmark" href="favicon.ico" />
    <link rel="apple-touch-icon" href="favicon.ico" />
    <!--ios和Android都支持-->
    <link rel="apple-touch-icon-precomposed" href="favicon.ico" />
    <title>写给赵宝宝的程序</title>
    <style>
      #preloader {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 99999;
        display: flex;
        flex-flow: row nowrap;
        justify-content: center;
        align-items: center;
        background: none repeat scroll 0 0 #ffffff;
      }

      .sk-spinner-pulse {
        width: 60px;
        height: 60px;
        background-color: #222;
        border-radius: 100%;
        -webkit-animation: sk-pulseScaleOut 1s infinite ease-in-out;
        animation: sk-pulseScaleOut 1s infinite ease-in-out;
      }

      @-webkit-keyframes sk-pulseScaleOut {
        0% {
          -webkit-transform: scale(0);
          transform: scale(0);
        }

        100% {
          -webkit-transform: scale(1);
          transform: scale(1);
          opacity: 0;
        }
      }

      @keyframes sk-pulseScaleOut {
        0% {
          -webkit-transform: scale(0);
          transform: scale(0);
        }

        100% {
          -webkit-transform: scale(1);
          transform: scale(1);
          opacity: 0;
        }
      }
    </style>
  </head>

  <body>
    <noscript>
      <strong
        >We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
        properly without JavaScript enabled. Please enable it to
        continue.</strong
      >
    </noscript>
    <div id="preloader">
      <div class="sk-spinner sk-spinner-pulse"></div>
    </div>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
  <script type="text/javascript">
    document.addEventListener('plusready', function () {
      var webview = plus.webview.currentWebview();
      plus.key.addEventListener('backbutton', function () {
        webview.canBack(function (e) {
          if (e.canBack) {
            webview.back();
          } else {
            //webview.close(); //hide,quit
            //plus.runtime.quit();
            //首页返回键处理
            //处理逻辑：1秒内，连续两次按返回键，则退出应用；
            var first = null;
            plus.key.addEventListener(
              'backbutton',
              function () {
                //首次按键，提示‘再按一次退出应用’
                if (!first) {
                  first = new Date().getTime();
                  console.log('再按一次退出应用');
                  setTimeout(function () {
                    first = null;
                  }, 1000);
                } else {
                  if (new Date().getTime() - first < 1500) {
                    plus.runtime.quit();
                  }
                }
              },
              false
            );
          }
        });
      });
    });
  </script>
  <script>
    fnResize();
    window.onresize = function () {
      fnResize();
    };

    function fnResize() {
      var deviceWidth =
        document.documentElement.clientWidth || window.innerWidth;
      if (deviceWidth >= 750) {
        deviceWidth = 750;
      }
      if (deviceWidth <= 320) {
        deviceWidth = 320;
      }
      document.documentElement.style.fontSize = deviceWidth / 7.5 + 'px';
    }

    window.onload = function () {
      setTimeout(function () {
        document.getElementById('preloader').style.display = 'none';
      }, 100);
    };
  </script>
</html>
